package Test;

import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);

        System.out.println("请输入您的姓名");
        String Name =s.next();

        System.out.println("请输入您的身高(m)");
        double d1 = s.nextDouble();

        System.out.println("请输入您的体重(kg)");
        double d2 = s.nextDouble();

        double Bmi = d2/(d1*d1);
        System.out.println(Name+"您的肥胖指数为："+Bmi);

        if(Bmi>=35){
            System.out.println("您重度肥胖");
        }else if(Bmi >=30){
            System.out.println("您中度肥胖");
        }else if(Bmi >=27){
            System.out.println("您轻度肥胖");
        }else if(Bmi >=24){
            System.out.println("您体重过重");
        }else if(Bmi >=18.5){
            System.out.println("恭喜！您的体重在正常范围");
        }else if(Bmi <18.5 & Bmi >= 0){
            System.out.println("您的体重过轻");
        }else{
            System.out.println("您输入的数据不合法");
        }

        //精简
        String str;

        if(Bmi>=35){
            str = "您重度肥胖";
        }else if(Bmi >=30){
            str = "您中度肥胖";
        }else if(Bmi >=27){
            str = "您轻度肥胖";
        }else if(Bmi >=24){
            str = "您体重过重";
        }else if(Bmi >=18.5){
            str = "恭喜！您的体重在正常范围";
        }else if(Bmi <18.5 & Bmi >= 0){
            str = "您的体重过轻";
        }else{
            str = "您输入的数据不合法";
        }

        System.out.println(str);
    }
}
